﻿@using CoreData
@model List<Article>
@if (Model != null && Model.Count() > 0)
{
    <div class="grid-view">
        <div class="grid-title">
            <h3>
                Bài viết liên quan</h3>
        </div>
        <ul class="row-product">
            @foreach (var item in Model)
            {
                <li class="column-product">
                    <div class="column-inner">
                        <div class="product-thumbnail">
                            <a href="@Url.RouteUrl("article_details", new { Id = item.ID, Link = item.Link })" title="@item.Title">
                                <img src="/Media/Article/@item.Image" alt="@item.Image" />
                            </a>
                        </div>
                        <div class="product-details">
                            @{
                var ArticleName = item.Title;
                if (ArticleName.Length > 25)
                {
                    ArticleName = ArticleName.Substring(0, 25) + "...";
                }
                                <h1 class="product-title">
                                    <a href="@Url.RouteUrl("article_details", new { Id = item.ID, Link = item.Link })">@ArticleName</a></h1>
                            }
                            <div class="small-detail">
                                <span class="detail-item">
                                    <label>
                                        Cập nhật ngày:</label><span>@item.UpdateDate.ToString("dd/MM/yyyy")</span></span>
                            </div>
                        </div>
                    </div>
                </li>
            }
        </ul>
        <div class="clearfix">
        </div>
    </div>
}